<include file='Common:header'/>

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            会员组管理
            <small></small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="{:U('Index/index')}"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li class="active">会员组管理</li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">

        <!-- START CUSTOM TABS -->
        <div class="row">
            <div class="col-xs-12">
                <!-- Custom Tabs -->
                <div class="nav-tabs-custom">

                    <ul class="nav nav-tabs">

                        <li class="active"><a href="#tab_detail" data-toggle="tab" rel="tab_detail">会员组列表</a></li>
                        <li><a href="javascript:void(0)" onclick="addData()">添加会员组</a></li>

                        <li class="pull-right"><a href="javascript:void(0)" onclick="addData()" class="text-muted"><i class="fa fa-gear"></i></a></li>
                    </ul>

                    <div class="tab-content">

                        <div class="tab-pane active" id="tab_detail">


                            <div style="width:100%;">
                                <form role="form" method="post">
                                    <div class="box">
                                        <div class="box-header with-border">
                                            <h3 class="box-title">用户列表</h3>
                                        </div><!-- /.box-header -->
                                        <div class="box-body no-padding">

                                            <div class="col-xs-12">
                                                <!-- general form elements -->
                                                <div class="box box-primary">

                                                    <div class="box-header">
                                                        <div class="box-left">
                                                            <div style="width: 400px;" class="input-group">
                                                                <div class="columns columns-right btn-group pull-left">
                                                                    <button title="删除选中" name="delete" type="button"
                                                                            data-fun="del"
                                                                            class="btn btn-default"><i
                                                                            class="glyphicon glyphicon-trash"></i>
                                                                    </button>
                                                                    <button title="刷新" name="refresh" type="button"
                                                                            class="btn btn-default"><i
                                                                            class="glyphicon glyphicon-refresh icon-refresh"></i>
                                                                    </button>
                                                                    <!--
                                                                    <button title="展开/折叠" name="toggle" type="button"
                                                                            class="btn btn-default"><i
                                                                            class="glyphicon glyphicon-list-alt icon-list-alt"></i>
                                                                    </button>
                                                                    <div class="export btn-group">
                                                                        <button type="button" data-toggle="dropdown"
                                                                                class="btn btn-default dropdown-toggle"><i
                                                                                class="glyphicon glyphicon-save"></i>
                                                                            <span class="caret"></span></button>
                                                                        <ul role="menu" class="dropdown-menu">
                                                                            <li data-type="csv"><a
                                                                                    href="javascript:void(0)">CSV</a></li>
                                                                            <li data-type="excel"><a
                                                                                    href="javascript:void(0)">Excel</a>
                                                                            </li>
                                                                        </ul>
                                                                    </div>
                                                                    -->
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div><!-- /.box-header -->

                                                    <table class="table table-condensed table-striped table-bordered table-hover dataTable no-footer">
                                                        <tbody><tr>
                                                            <th class="text-center took-w40">
                                                                <input type="checkbox" name="btSelectAll">
                                                            </th>
                                                            <th style="width: 50px">rid</th>
                                                            <th>会员组名</th>
                                                            <th class="text-center">系统组</th>
                                                            <th>积分上限</th>
                                                            <th class="text-center">评论不需要审核</th>
                                                            <th class="text-center">允许发短消息</th>
                                                            <th class="text-center" style="width: 180px">操作</th>
                                                        </tr>

                                                        <volist name="data" id="d">
                                                            <tr>
                                                                <td class="text-center">
                                                                    <input type="checkbox" name="ids" value="{$d.rid}" class="inverted">
                                                                </td>
                                                                <td>{$d.rid}</td>
                                                                <td>{$d.rname}</td>
                                                                <td class="res-status text-center" data-url="" data-id="{$d.rid}" data-status-ok="是" data-status-no="否">
                                                                    <if condition="$d[system] eq 1">
                                                                        <span data-toggle="tooltip" title="是">
                                                                            <i class="icon fa fa-check text-green"></i>
                                                                        </span>
                                                                        <else/>
                                                                        <span data-toggle="tooltip" title="否">
                                                                            <i class="icon fa fa-close text-red"></i>
                                                                        </span>
                                                                    </if>
                                                                </td>
                                                                <td>{$d.creditslower}</td>
                                                                <td class="res-status text-center" data-url="" data-id="{$d.rid}" data-status-ok="是" data-status-no="否">
                                                                    <if condition="$d[comment_state] eq 1">
                                                                        <span data-toggle="tooltip" title="是">
                                                                            <i class="icon fa fa-check text-green"></i>
                                                                        </span>
                                                                        <else/>
                                                                        <span data-toggle="tooltip" title="否">
                                                                            <i class="icon fa fa-close text-red"></i>
                                                                        </span>
                                                                    </if>
                                                                </td>
                                                                <td class="res-status text-center" data-url="" data-id="{$d.rid}" data-status-ok="是" data-status-no="否">
                                                                    <if condition="$d[allowsendmessage] eq 1">
                                                                        <span data-toggle="tooltip" title="是">
                                                                            <i class="icon fa fa-check text-green"></i>
                                                                        </span>
                                                                        <else/>
                                                                        <span data-toggle="tooltip" title="否">
                                                                            <i class="icon fa fa-close text-red"></i>
                                                                        </span>
                                                                    </if>
                                                                </td>
                                                                <td class="text-center">
                                                                    <a href="javascript:editData({$d.rid})" title="修改"><i class="glyphicon glyphicon-edit"></i></a> &nbsp;
                                                                    <a href="javascript:del({$d.rid})" title="删除"><i class="glyphicon glyphicon-trash"></i></a>
                                                                </td>
                                                            </tr>
                                                        </volist>

                                                        </tbody></table>

                                                </div><!-- /.box -->

                                            </div>

                                        </div><!-- /.box-body -->
                                    </div><!-- /.box -->
                                </form>

                            </div>
                        </div><!-- /.tab-pane -->

                    </div><!-- /.tab-content -->


                </div><!-- nav-tabs-custom -->
            </div><!-- /.col -->

        </div> <!-- /.row -->
        <!-- END CUSTOM TABS -->

    </section><!-- /.content -->
</div><!-- /.content-wrapper -->

<script>
    //添加
    function addData() {
        var title = '添加会员组';
        var url = "{:U('add')}";
        ajaxForm(url, title);
    }

    //编辑
    function editData(id) {
        var title = '编辑会员组';
        var url = "{:U('edit',array('rid'=>''))}" + id;
        ajaxForm(url, title);
    }

    //删除
    function del(id) {
        delItem("{:U('del')}", {rid: id});
    }
</script>

<include file='Common:footer'/>